{#
(C) Copyright 2011 Jose Carrasco <jose.carrasco[a]vikuit.com>
(C) Copyright 2011 Jose Blanco <jose.blanco[a]vikuit.com>

This file is part of "vikuit".

"vikuit" is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

"vikuit" is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with "vikuit".  If not, see <http://www.gnu.org/licenses/>
. #}
        {% if sess.user and user.rol == 'admin'%}
            
                {% set navigation_bar = [
                    ('/', 'index', _('Init')),
                    ('/module/article.list', 'article', _('Articles')),
                    ('/module/community.list', 'community', _('Communities')),
                    ('/forum.list', 'forum', _('Forums')),
                    ('/module/user.list', 'user', _('Users')),
                    ('/module/mblog/mblog.list', 'microblogging', _('Microblogging')),
                    ('/admin', 'admin', _('Administration')),
                    ('/html/about.html', 'about', _('About vikuit'))
                ] %}
            
        {% else %}

            {% set navigation_bar = [
                ('/', 'index', _('Init')),
                ('/module/article.list', 'article', _('Articles')),
                ('/module/community.list', 'community', _('Communities')),
                ('/forum.list', 'forum', _('Forums')),
                ('/module/user.list', 'user', _('Users')),
                ('/module/mblog/mblog.list', 'microblogging', _('Microblogging')),
                ('/html/about.html', 'about', _('About vikuit'))
            ] %}
        
        {% endif %}

		<div class="Cps_menu">
			<ul class="nav">	 
				{% for href, id, caption in navigation_bar %}
				  {% if  href == tab %}
					<li class="Cps_current round-top">
						<div class="sublinks_tabbed"><a href="{{ href|e }}">{{ caption}}</a></div>
					</li>
				  {% else %}
					<li class="Cps_tab round-top">
						<div><a href="{{ href|e }}">{{ caption }}</a></div>
					</li>
				  {% endif %}
				{% endfor %}
            {% if sess.user %}
                
                <li class="Cps_top round-top"><a href="#" class="Cps_top_link">{{ _('Account') }}</a>
                    <div class="sub">
                     <ul>
                            <li class="title">{{ _('Your lifestreaming') }}</li> 
                            <li><a href="/module/user.events" ><img src="/static/images/heart.png" alt="" class="icon" /> {{ _('Your lifestreaming') }}</a></li>
                            <li><a href="/module/user/{{ user.nickname }}" ><img src="/static/images/user.png" alt="" class="icon" /> {{ _('Your public profile') }}</a></li>
                            <li><a href="/module/user.articles/{{ user.nickname }}" ><img src="/static/images/page_white_text.png" alt="" class="icon" /> {{ _('Your articles') }}</a></li>
                            <li><a href="/module/user.forums/{{ user.nickname }}" ><img src="/static/images/comments.png" alt="" class="icon" /> {{ _('Your threads') }}</a></li>
                            <li><a href="/module/user.favourites/{{ user.nickname }}" ><img src="/static/images/star.png" alt="" class="icon" /> {{ _('Your favorites') }}</a></li>
                            <li><a href="/module/user.communities/{{ user.nickname }}" ><img src="/static/images/community.png" alt="" class="icon" /> {{ _('Your communities') }}</a></li>
                            <li><a href="/module/user.contacts/{{ user.nickname }}" ><img src="/static/images/user.png" alt="" class="icon" /> {{ _('Your contacts') }}</a></li>
                            <li><a href="/invite" ><img src="/static/images/user_comment.png" alt="" class="icon" /> {{ _('Invite your friends') }} </a></li>
                    </ul>
                    <ul>
                            <li class="title">{{ _('Inbox') }}</li>                       
                            <li><a href="/message.inbox" ><img src="/static/images/email.png" alt="" class="icon" /> {{ _('Inbox') }} {% if user.unread_messages %}({{ user.unread_messages}}){% endif %}</a></li>
                            <li><a href="/message.sent" ><img src="/static/images/email_edit.png" alt="" class="icon" /> {{ _('Sent messages') }}</a></li>
                            <li class="title">{{ _('Preferences') }}</li>
                            <li><a href="/module/user.changepassword?redirect_to={{ redirect }}"><img src="/static/images/key.png" alt="" class="icon" /> {{ _('Change password') }}</a></li>
                            <li><a href="/module/user.edit"><img src="/static/images/cog.png" alt="" class="icon" /> {{ _('Preferences') }}</a></li>
                    </ul>
                        <p class="logO"><a href="{{ logout }}"><img src="/static/images/logout.png" alt="" class="icon" /> {{ _('Logout') }}</a></p>
                   </div>
                </li>
                
        {% else %}    

              {% if  href == tab %}
                <li class="Cps_current round-top" style="float: right !important;">
                    <a href="/module/user.login?redirect_to={{ redirect }}" class="Cps_top_link">{{ _('Log in') }}</a>
                </li>
              {% else %}
                <li class="Cps_tab round-top" style="float: right !important;">
                    <a href="/module/user.login?redirect_to={{ redirect }}" class="Cps_top_link">{{ _('Log in') }}</a>
                </li>
              {% endif %}
      
        {% endif %}
			</ul>
		</div>

{% block javascript %} {% endblock %}
